import { NgModule } from '@angular/core';
import { RouterModule, Routes } from '@angular/router';
import { MenuMgmtComponent } from './menu-mgmt/menu-mgmt.component';
import { UserMgmtComponent } from './user-mgmt/user-mgmt.component';
import { RoleMgmtComponent } from './role-mgmt/role-mgmt.component';
import { RoleAuthorityComponent } from './role-mgmt/role-authority.component';

const routes: Routes = [
    {
        path: '',
        children: [
            {
                path: '',
                redirectTo: 'menuMgmt',
            },
            {
                path: 'menuMgmt',
                component: MenuMgmtComponent,
                data: {
                    title: '菜单管理',
                    url: 'systemMgmt/menuMgmt'
                }
            },
            {
                path: 'userMgmt',
                component: UserMgmtComponent,
                data: {
                    title: '系统用户管理',
                    url: 'systemMgmt/userMgmt'
                }
            },
            {
                path: 'roleMgmt',
                component: RoleMgmtComponent,
                data: {
                    title: '系统角色管理',
                    url: 'systemMgmt/roleMgmt'
                }
            },
            {
                path: 'roleAuthority',
                component: RoleAuthorityComponent,
                data: {
                    title: '系统角色管理',
                    url: 'systemMgmt/roleMgmt'
                }
            },
            {
                path: '**',
                redirectTo: 'home',
            },
        ]
    }
];

@NgModule({
    imports: [RouterModule.forChild(routes)],
    exports: [RouterModule]
})
export class SystemManagementRoutingModule { }
